const { defineConfig } = require("@vue/cli-service");

//别名配置的方法
// const path = request("path");
// function resolve(dir) {
//   return path.join(__dirname, dir);
// }

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  // 配置代理
  publicPath: ".",
  devServer: {
    proxy: {
      "/api": {
        target: process.env.VUE_APP_BASE_URL, //目标服务器
        pathRewrite: {
          //路径重写
          "^/api": "",
        },
      },
    },
  },

  // 配置别名：引入文件的路径可以简写
  // chainWebpack: (config) => {
  //   config.resolve.alias
  //     .set("%", resolve("src"))
  //     .set("assets", resolve("src/assets"))
  //     .set("components", resolve("src/components"))
  //     .set("layout", resolve("src/layout"))
  //     .set("base", resolve("src/base"))
  //     .set("static", resolve("src/static"));
  // },
});
